package com.fy.fyzf.weight;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.fy.fyzf.R;

public class DeleteImageView extends RelativeLayout {

    private ImageView mImg;
    private ImageView mIv_delete;

    public DeleteImageView(Context context) {

        this(context, null);

    }

    public DeleteImageView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public DeleteImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        LayoutInflater inflater = LayoutInflater.from(context);
        View view= inflater.inflate(R.layout.delete_view,this);

        mImg = view.findViewById(R.id.iv_img);
        mIv_delete = view.findViewById(R.id.iv_delete);
    }

    //向外部提供接口
    public ImageView getImg() {
        return mImg;
    }
    public ImageView getDeleteIcon(){
        return mIv_delete;
    }
    public void setDeleteListener(OnClickListener onClickListener){
        mIv_delete.setOnClickListener(onClickListener);
    }

}

